<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@page contentType="text/html;charset=utf-8" isELIgnored="false" %>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>个人信息 - 光年(Light Year Admin)后台管理系统模板</title>
<link rel="icon" href="${base}/favicon.ico" type="image/ico">
<meta name="keywords" content="LightYear,光年,后台模板,后台管理系统,光年HTML模板">
<meta name="description" content="LightYear是一个基于Bootstrap v3.3.7的后台管理系统的HTML模板。">
<meta name="author" content="yinqi">
<link href="${base}/css/bootstrap.min.css" rel="stylesheet">
<link href="${base}/css/materialdesignicons.min.css" rel="stylesheet">
<link href="${base}/css/style.min.css" rel="stylesheet">
</head>
  
<body>

    <!--页面主要内容-->
    <div class="container-fluid">
      <div class="row">
        <div class="col-lg-12">
          <div class="card">
            <div class="card-body">
                <label style="font-size: 30px">看帖子</label>
              <div class="edit-avatar">
                <img src="${base}/upload/${p.user.headpic}" alt="..." class="img-avatar">
                <div class="avatar-divider">
                  <a href="${base}/post/homePage?homeId=${p.user.id}" style="font-size: 20px">${p.user.name}</a>
                </div>
              </div>
              <hr>
                <div style="font-size: 20px" class="form-group">
                    类型:${p.pt.type}
                </div>
                <div style="font-size: 30px" class="form-group">
                ${p.title}
                </div>
                <div style="height: 200px;width: 600px;border: 1px gainsboro solid" class="form-group">
                  ${p.content}
                </div>
              <div class="form-group">
                  <c:choose>
                    <c:when test="${requestScope.goodList.contains(theUser.id)}">
                      <a style="font-size: 30px" href="${base}/post/cancelSupport?id=${p.id}">
                          <span class="mdi mdi-heart" style="color: red"></span>
                      </a>
                    </c:when>
                    <c:otherwise>
                      <a style="font-size: 30px" href="${base}/post/doSupport?id=${p.id}">
                          <span class="mdi mdi-heart" style="color: gainsboro"></span>
                      </a>
                    </c:otherwise>
                  </c:choose>
                  &emsp;
                  <span style="font-size: 20px">点击量:${p.click}</span>
                  &emsp;
                  <span style="font-size: 20px">点赞量:${p.support}</span>
                  &emsp;
                  <span style="font-size: 20px">评论条数:${p.comments}</span>
              </div>
              <form action="${base}/postComments/add" method="post">
                <input type="hidden" name="postid" value="${p.id}">
                <input type="hidden" name="commenterid" value="${theUser.id}">
                <div style="font-size: 20px" class="form-group">
                  发评论<input type="text" name="content" style="width: 500px"><button>发送</button>
                </div>
              </form>
                <hr style="height: 3px" color="pink">
              <div class="form-group">
                <c:forEach var="comment" items="${p.pcs}">
                  <div style="display: flex;justify-content: space-between;font-size: 18px" >
                      <div>
                          <img style="height: 40px;width: 40px;border-radius: 40px" src="${base}/upload/${comment.user.headpic}">
                          <c:if test="${comment.user.id==p.user.id}">
                              <span style="color:blue;">楼主</span>
                          </c:if>
                          <span <c:if test="${comment.user.id==theUser.id}">style="color: gold; " </c:if>>
                                  ${comment.user.name}
                          </span>
                          <span>:${comment.content}</span>
                      </div>
                      <div><fmt:formatDate value="${comment.time}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></div>
                  </div>
                </c:forEach>

              </div>
            </div>
          </div>
        </div>

      </div>

    </div>


<script type="text/javascript" src="${base}/js/jquery.min.js"></script>
<script type="text/javascript" src="${base}/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${base}/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="${base}/js/main.min.js"></script>
</body>
</html>